<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>管理员界面</title>
    <link rel="stylesheet" href="../layui/css/layui.css">
    <link rel="stylesheet" href="../css/comment.css">
</head>
<body class="layui-layout-body">
<div class="layui-layout layui-layout-admin">
    <div class="layui-header">
        <div class="layui-logo">管理员界面</div>
        <!-- 头部区域（可配合layui已有的水平导航） -->

        <ul class="layui-nav layui-layout-right">
            <li class="layui-nav-item">
                <a href="javascript:;">
                    <img src="../upload/img/header/header.png" class="layui-nav-img">
                    高晋峰
                </a>
                <dl class="layui-nav-child">
                    <dd><a href="">基本资料</a></dd>
                    <dd><a href="">安全设置</a></dd>
                    <dd>
            <li class="layui-nav-item"><a href="">退出</a></li>
        </ul>
    </div>

    <div class="layui-side layui-bg-black">
        <div class="layui-side-scroll">
            <!-- 左侧导航区域（可配合layui已有的垂直导航） -->
            <ul class="layui-nav layui-nav-tree" lay-filter="test">
                <li class="layui-nav-item layui-nav-itemed">
                    <a class="" href="javascript:;">系统管理</a>
                    <dl class="layui-nav-child">
                        <dd><a href="#!user">用户管理</a></dd>
                        <dd><a href="#!goods">商品管理</a></dd>
                        <dd><a href="#!comment">留言管理</a></dd>
                        <dd><a href="#!loginRecord">登陆日志</a></dd>
                        <dd><a href="">超链接</a></dd>
                    </dl>
                </li>

            </ul>
        </div>
    </div>

    <div class="layui-body">
        <!-- 内容主体区域 -->
        <div id="main" style="padding: 15px;">内容主体区域</div>
    </div>

    <div class="layui-footer" style="text-align: center">
        <!-- 底部固定区域 -->
        <p>Copyright © 2018 <a href="javascript:;">YNZH</a> All Rights Reserved.</p>
    </div>
</div>
<script src="../layui/layui.js"></script>
<script src="../js/q.js"></script>
<script>
    //JavaScript代码区域
    layui.use(['element', 'layer'], function () {
        var element = layui.element,
            layer = layui.layer;
        $ = layui.$;

        Q.reg()

        $(document).ready(function () {
            initRoute();
        });


        function initRoute() {
            Q.reg('goods', function () {
                loadView('goods');
            }).reg('comment', function () {
                loadView('comment');
            }).reg('loginRecord', function () {
                loadView('loginRecord');
            }).reg('user', function () {
                loadView('user');
                // console.log("goods id is " + id);
                // sessionStorage.setItem("curGoodsId", id);
                console.log(Q.lash);
            });

            Q.init({
                index: 'user'
            });

        }

        function loadView(path) {
            $("#main").load("admin/" + path + ".html", function () {
                console.log("change path to " + path);
            });
        }

    });

</script>
</body>
</html>